﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DataAccess.SqlClient;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
  public  class sy_lianjieDAL
    {

        /// <summary>
        /// 友情链接---更多显示
        /// </summary>
        /// <returns></returns>
      public static dynamic sy_lianjieShow()
        {
            var q = new SqlQuery
            {
                CommandText = "select top 3 * from lianjie",
            };
            var dt = SqlDataAccess.ExecDataset(q).Tables[0];//连接数据库，获取友情链接---更多显示
            var list = new List<dynamic>();
            foreach (var dr in dt.Select())
            {
                list.Add(

                    new
                    {
                        lid = dr.Field<Guid>("lid"),
                        lame = dr.Field<string>("lame"),
                        lurl = dr.Field<string>("lurl"),
                    }
                    );
            }
            return list;
        }
    }
}
